//
//  KitAndDefine.swift
//  DingDongZP
//
//  Created by 三秒文化 on 16/4/6.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

import UIKit
import ReactiveCocoa



//public let isDebug:Bool = false
//判断 debug app类型
public let isDebug:Bool = DDAPIGenerate.sharedInstance().serverType == kLinkServerType.LinkServerTypeOfTest ? true:false
//public let isDebug:Bool = {
//  
//    #if DEBUG
//        return true
//    #else
//        return false
//    #endif
//}()


//通知
public let NotiEidtExpJobName = "NOTI_CATTLE_EDIT_EXPECTJOB"
public let NotiEmployerSetCurrentJob = "NOTI_EMPLOYER_SET_CURRENTJOB"
public let NotiCommunicaionCurrentJob = "NOTI_CATTLE_COMMUNICATION_EXPECTJOB"

public let NOTI_GUIDERIMGVIEW_END  =   "NOTI_GUIDERIMGVIEW_END"//引导页结束



public let LDRecoderUrl = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.AllDomainsMask, true).last! + "/recoder"


/** MeRootNAV */
//public var LDMeRootNav = UIApplication.sharedApplication().keyWindow?.rootViewController?.childViewControllers[0] as! LDRootNavVC//3
//public let LDMessageRootNav = UIApplication.sharedApplication().keyWindow?.rootViewController?.childViewControllers[0] as! LDRootNavVC//2
//public let LDWorthRootNav = UIApplication.sharedApplication().keyWindow?.rootViewController?.childViewControllers[0] as! LDRootNavVC//1
public let LDTabBarVC = UIApplication.sharedApplication().keyWindow?.rootViewController// as? LDMainTabBarVC
//    .childViewControllers[3] as! DDNavigationController

/** 默认客服的ID */
public let LDRCIMCustomerID = "KEFU146337874557005"

public let LDUmengAppKey =               "56e5236467e58efaf000134f"
public let LDBugTagsAppKey =              "a492cb38fc5520ce6935f33a713bc4e5"

public let LDImagePre   =                "https://114.55.59.142/appws/logo/"

public let LDRegisterAgreementURL  =     "https://114.55.59.142/appws/useragreement.php"

public let LDWechatAPP_ID  =             "wx6715d25ff26c2770"
public let LDWechatAPP_Secret  =         "d31d207bfd86dcf46297d830603ae16e"

public let LDWeiboAPP_ID   =             "1953117554"
public let LDWeiboAPP_Secre =            "ca6e7030798b10fe05f807621986da81"

public let LDShareTitle      =           "叮咚快聘"
public let LDShareContent    =           "叮咚快聘介绍"
public let LDShareURL       =            "https://www.51ledian.com"

//个推
public let LDGeTuiAppID        =         "GzeT2gOmAu5UviGhPdoJ33"
public let LDGeTuiAppKey       =         "9bjLqRm9yz9jDO1JlW4qy9"
public let LDGeTuiSecret        =        "5E84d1HF8J82fHDkcfSnJ6"

//融云
public let LDRongCloudAppKey       =      "uwd1c0sxd9w51"
//融云客服
public let LDCustomerTatgetID      =      isDebug ? "KEFU146337874557005":"KEFU147876983343063"

//分享叮咚快聘
public let LDShareDingDong      =     "https://www.dingdong.cc"
public let kShareTitle          =        "叮咚快聘-叮咚，敲开未来之门！"
public let kShareContent        =       "叮咚快聘，真诚的Boss and魅力四射的牛人在这里相聚。每天数十万Boss和牛人找到心仪的ta。无等待，不犹豫，短短5分钟即可开聊，从此踏上人生巅峰!"
public let kShareURL            =       "https://www.dingdong.cc"
//xml configure
public let LDAppXMLCacheKey     =       "LDAPPXMLCACHEKEYINFO"
public let LDAppXMLUpdateKey     =      "LDAPPXMLUPDATEKEYINFO"




/** Version */
public let LDAppVersion = NSBundle.mainBundle().infoDictionary!["CFBundleShortVersionString"] as? String ?? "1"
public let LDAppBuild = NSBundle.mainBundle().infoDictionary!["CFBundleVersion"] as? String ?? "1"

/** NUll置空判断 */
public let LDNull:String = "NULL"

/** cache目录 */
struct LDCache {
    
    static let JobFinderInfoString = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] + "/cacheDocment/JobFinderInfo"
    static let EmployerInfoString = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] + "/cacheDocment/EmployerInfo"
    
    static let JobFinderInfoRealm = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] + "/cacheDocment/JobFinderRealm"
    static let JobFinderInfoVoiceResume = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] + "/cacheDocment/myResumeVoice"
    static let JobFinderInfoMessage = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] + "/cacheDocment/JobFinderInfoMessage"
}
struct LDCoraDataEntryName {
    static let publicEntry = "PublicInfo"
}



/** 设备型号 */
func deviceDetailsModel() ->String {
    
    var systemInfo = utsname()
    uname(&systemInfo)
    
    let modelCode = withUnsafeMutablePointer(&systemInfo.machine) {
        
        ptr in String.fromCString(UnsafePointer<CChar>(ptr))
    }
    return modelCode!
}

/** 语音微简历数组 */
public let LDMyVoiceResumeAPIArr:Array<String> = [LDJobfinderAPI.download.audio.highlights,
                                  LDJobfinderAPI.download.audio.mystrengths,
                                  LDJobfinderAPI.download.audio.workexperience,
                                  LDJobfinderAPI.download.audio.eduexperience]


